@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@mixin scrollBar {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}


@mixin scrollBar2 {
  &::-webkit-scrollbar-track-piece {
    background-color: transparent;
  }

  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background-color: transparent;
  }

  &::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: hsla(220, 4%, 58%, 0.9);
  }
}

@mixin scrollBar3($color) {
  &::-webkit-scrollbar-track-piece {
    background-color: transparent;
  }

  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background-color: transparent;
  }

  &::-webkit-scrollbar-thumb {
    border-radius: 5px;
    // background-color: hsla(220, 4%, 58%, 0.3);
    background-color: $color;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin pct($pct) {
  width: #{$pct};
  position: relative;
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  height: 0;
  width: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }

  @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}

@mixin Rgba($position,
  $width,
  $height,
  $filter,
  $beforeColor,
  $color,
  $box-shadow) {
  @if ($box-shadow) {
    box-shadow: $box-shadow;
  }

  border-radius: 8px;
  overflow: hidden;
  z-index: 0;
  position: $position;

  &:before {
    content: "";
    /* 必须包括 */
    position: absolute;
    /* 固定模糊层位置 */
    width: ($width + 50px);
    height: ($height + 50px);
    left: -25px;
    /* 回调模糊层位置 */
    top: -25px;
    /* 回调模糊层位置 */
    background: $beforeColor;
    filter: blur(20px);
    z-index: -2;
  }

  .rgba {
    position: absolute;
    width: $width;
    height: $height;
    z-index: -1;
    filter: blur($filter);
    background-color: $color;
  }
}
